import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:geomancy/styles/index.dart';
import 'package:geomancy/widgets/common_circle_btn.dart';
import 'package:geomancy/widgets/common_text.dart';

class HomeItemWidget extends StatelessWidget {
  final String content;
  final String iconPath;
  final void Function() onTap;
  const HomeItemWidget({super.key, required this.content, required this.iconPath, required this.onTap});

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      width: 670.w,
      height: 230.w,
      child: Stack(
        children: [
          Align(
            child: Container(
              width: 670.w,
              height: 180.w,
              padding: EdgeInsets.only(right: 14.w, left: 220.w),
              alignment: Alignment.centerRight,
              decoration: BoxDecoration(
                  color: ColorStyle.themeLightColor,
                  border: Border.all(width: 5.w, color: ColorStyle.borderColor),
                  borderRadius: BorderRadius.all(Radius.circular(90.w))
              ),
              child: Row(
                children: [
                  Expanded(child: CommonText(txt: content, fontSize: 26.sp)),
                  SizedBox(width: 6.w,),
                  CommonCircleBtnWidget(size: 150.w, txt: '开始', onTap: onTap)
                ],
              ),
            ),
          ),
          Align(
            alignment: Alignment.centerLeft,
            child: Container(
              width: 215.w,
              height: 215.w,
              decoration: BoxDecoration(
                  color: ColorStyle.themeColor,
                  border: Border.all(width: 5.w, color: ColorStyle.borderColor),
                  borderRadius: BorderRadius.all(Radius.circular(125.w))
              ),
              child: Image.asset(iconPath, width: 230.w),
            ),
          ),
        ],
      ),
    );
  }
}
